<?php
// +----------------------------------------------------------------------
// | KITEGO-Admin「开箱即用」「人人全栈」
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.kitego.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed KITEGO并不是自由软件，未经许可不能去掉KITEGO相关版权
// +----------------------------------------------------------------------
// | Author: KITEGO Team <bd@kitego.cn>
// +----------------------------------------------------------------------

use app\adminapi\middleware\AdminLoginMiddleware;
use think\facade\Route;

Route::group('setting', function () {

    // 无需登录
    Route::group(function () {
    })->option(['parent' => 'setting', 'cateName' => '系统配置相关']);

    // 需要登录
    Route::group(function () {

        Route::get('refreshCache', 'v1.setting.ToolController/refreshCache')->option(['realName' => '强制刷新缓存']);

        Route::group('menu', function () {
            Route::get('list', 'v1.setting.SystemMenuController/listSystemMenu')->option(['realName' => '管理菜单列表']);
            Route::post('edit', 'v1.setting.SystemMenuController/editSystemMenu')->option(['realName' => '编辑菜单']);
            Route::post('del', 'v1.setting.SystemMenuController/delSystemMenu')->option(['realName' => '软删菜单']);
            Route::post('sort', 'v1.setting.SystemMenuController/sortSystemMenu')->option(['realName' => '排序菜单']);
        })->option(['parent' => 'setting', 'cateName' => '系统菜单相关']);

        Route::group('role', function () {
            Route::get('list', 'v1.setting.SystemRoleController/listSystemRole')->option(['realName' => '角色列表']);
            Route::post('edit', 'v1.setting.SystemRoleController/editSystemRole')->option(['realName' => '编辑角色']);
            Route::post('batchDel', 'v1.setting.SystemRoleController/batchDelSystemRole')->option(['realName' => '批量删除角色']);
            Route::get('getRoleMenuIds', 'v1.setting.SystemRoleController/getRoleMenuIds')->option(['realName' => '获取角色菜单']);
        })->option(['parent' => 'setting', 'cateName' => '系统角色相关']);

        Route::group('dept', function () {
            Route::get('list', 'v1.setting.SystemDeptController/listSystemDept')->option(['realName' => '部门列表']);
            Route::post('edit', 'v1.setting.SystemDeptController/editSystemDept')->option(['realName' => '编辑部门']);
            Route::post('batchDel', 'v1.setting.SystemDeptController/batchDelSystemDept')->option(['realName' => '批量删除部门']);
        })->option(['parent' => 'setting', 'cateName' => '系统部门相关']);

        Route::group('admin', function () {
            Route::get('list', 'v1.setting.SystemAdminController/listSystemAdmin')->option(['realName' => '员工列表']);
            Route::post('edit', 'v1.setting.SystemAdminController/editSystemAdmin')->option(['realName' => '编辑员工']);
            Route::post('batchDel', 'v1.setting.SystemAdminController/batchDelSystemAdmin')->option(['realName' => '批量删除员工']);
        })->option(['parent' => 'setting', 'cateName' => '系统员工相关']);

    })->option(['parent' => 'setting', 'cateName' => '系统配置相关']);

    Route::group('attachmentCate', function () {
        Route::get('list', 'v1.setting.AttachmentCateController/attachmentCategoryList')->option(['realName' => '附件分类列表']);
        Route::post('add', 'v1.setting.AttachmentCateController/attachmentCategoryAdd')->option(['realName' => '附件分类新增']);
        Route::post('rename', 'v1.setting.AttachmentCateController/attachmentCategoryRename')->option(['realName' => '附件分类重命名']);
        Route::post('delete', 'v1.setting.AttachmentCateController/attachmentCategoryDelete')->option(['realName' => '附件分类删除']);
    })->option(['parent' => 'setting', 'cateName' => '附件分类相关']);

    Route::group('attachment', function () {
        Route::get('list', 'v1.setting.AttachmentController/attachmentList')->option(['realName' => '附件列表']);
        Route::post('upload', 'v1.setting.AttachmentController/attachmentUpload')->option(['realName' => '附件上传']);
        Route::post('move', 'v1.setting.AttachmentController/attachmentMove')->option(['realName' => '附件移动']);
        Route::post('rename', 'v1.setting.AttachmentController/attachmentRename')->option(['realName' => '附件重命名']);
        Route::post('delete', 'v1.setting.AttachmentController/attachmentDelete')->option(['realName' => '附件删除']);
    })->option(['parent' => 'setting', 'cateName' => '附件相关']);

})->middleware([])->option(['mark' => 'setting', 'markName' => '系统配置相关']);